gtkwindow: bail out on WM operations in the presence of grabs
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 4 Aug 2015 13:54:40 +0000 (15:54 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 4 Aug 2015 15:59:01 +0000 (17:59 +0200)
These operations will require a grab on the WM side, so we can spare the
attempt from the WM to take a grab when we're certain it won't suceed.

https://bugzilla.gnome.org/show_bug.cgi?id=752327

gtk/gtkwindow.c

index fb420a14b9f1228905dca572735e65d8e315fc2a..4e96d6f7126253dc8f890ce389127e1c5f418aee 100644 (file)
@@ -1445,6 +1445,13 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
 
   region = get_active_region_type (window, (GdkEventAny*) event, x, y);
 
+  if (gdk_display_device_is_grabbed (gtk_widget_get_display (widget),
+                                     gtk_gesture_get_device (GTK_GESTURE (gesture))))
+    {
+      gtk_gesture_set_state (priv->drag_gesture, GTK_EVENT_SEQUENCE_DENIED);
+      return;
+    }
+
   if (button == GDK_BUTTON_SECONDARY && region == GTK_WINDOW_REGION_TITLE)
     {
       if (gtk_window_titlebar_action (window, event, button, n_press))